home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows 95 API Bible
/
Windows 95 API Bible 3 Disc Set.iso
/
Win32 API Bible Book 1 of 3
/
CHAPTE20
/
EX5.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-19
|
2KB
|
47 lines
#include <genstub.c>
// WndProc Window message procedure
LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch (uMsg) // Process Windows messages.
{
case WM_COMMAND: // Process the menu items.
switch ( LOWORD( wParam ) )
{
case IDM_TEST: // Write the tick count to the INI file
InvalidateRect( hWnd, NULL, TRUE );
UpdateWindow( hWnd );
break;
case IDM_EXIT:
DestroyWindow( hWnd );
break;
}
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
TCHAR szBuffer[128];
UINT uCurrency = GetProfileInt( "Intl", // section name
"iCurrency", // key name
0 ); // default value
UINT uCurrencyDigits = GetProfileInt( "Intl" , // section name
"iCurrDigits", // key name
0 ); // default value
BeginPaint( hWnd, &ps );
wsprintf( szBuffer, "Currency setting is %d. Number of currency digits is %d.",
uCurrency, uCurrencyDigits);
TextOut( ps.hdc, 0, 0, szBuffer, lstrlen(szBuffer) );
EndPaint( hWnd, &ps );
}
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
return DefWindowProc( hWnd, uMsg, wParam, lParam );
}
return( 0L );
}
#include <about.c>